<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html style='height:100%;overflow: hidden;'>
  <head>
    <base href="<%=basePath%>">
    
    <title>客户档案管理</title>
    
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link rel="stylesheet" href="css/vivo.css">
	<link rel="stylesheet" href="css/bootstrap.css">
	<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/common.css">
	<link rel="stylesheet" href="js/font-awesome/css/font-awesome.css">
	<link rel="stylesheet" type="text/css" href="static/p_house/house_index.css" />
	<link rel="stylesheet" type="text/css" href="js/webuploader-0.1.5/webuploader.css" />
	<style type="text/css">
		.itab,.itab_content{
			margin: 20px;
		}
		.tabson{
			height:100%;
		}
		.itab ul li.active{
			background: #fff;
   			border-top: 1px solid #d3dbde;
		}
		.hiddenLi{
			display: none;
		}
	</style>
	
	<script src="js/jquery-1.11.1.js"></script>
	<script src="js/bootstrap2/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script> 
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="js/webuploader-0.1.5/webuploader.js"></script>
	<script type="text/javascript" src="js/sharefunction.js"></script> 
	<script type="text/javascript">
		//房间状态  0:空置  1：出租   2：自用  3：待出租
		var roomState = '${requestScope.customerStatus}';
      	$(function(){
      	//是否是历史页面
      		var history ='${history}';
      		$("#history").val(history);
      		var roomId = '${requestScope.roomId}';
      		var customerId = '${requestScope.customerId}';
      		if(history == 'yes'){
      			$("#cusIfr").attr("href","customerInfo/toHistoryCustomerDetail/"+customerId+"/"+roomId);
      		}
      		$(".itab ul>li a").click(function(){
      			$(this).parent().addClass("active").siblings().removeClass("active")
      		});
      		//修改选项卡样式，根据父页面字段来判断显示隐藏(选择不同房间显示不同选项卡)
      		statusModify();
      		
      		
      	});
      	
      	//根据房间id  去数据库表中查询产权人个数
      	var customerIdentity = '${requestScope.isPropertyOwner}';//0 :无产权人
      	var cIdentity = '${customerIdentity}';
      	function statusModify(){
      		//为房间id隐藏域赋值
			$("#roomId").val('${requestScope.roomId}');
			//为客户id隐藏域赋值
			var cid='${requestScope.customerId}';
			$("#customerId").val(cid);
      		//房间状态  0:空置  1：出租   2：自用  3：待出租
      		var obj = $("ul>li:eq(0) a")[0];
      		//如果客户id为"-"则是点新增按钮过来的,则什么也不判断
      		//console.log("cid="+cid);
      		if(cid=="-"){
      			if(customerIdentity=='0'){
	      			//新增产权人
	      			$(obj).text("产权人信息");
      			}else{
	      			$(obj).text("租赁人信息");
	      		}
      		}else{//id不为"-" 则是点击编辑按钮过来的  将customerIdentity 赋值成客户对应值该操作在新增客户页面进行赋值
      			 if(cIdentity==0){
      	      		//新增产权人
     	      		$(obj).text("产权人信息");
     	      		customerIdentity = 0;
      	      	}else if(cIdentity==1){
      	      		$(obj).text("租赁人信息");
      	      		customerIdentity = 1;
      	      	}
      			$("ul>li:gt(0)").css('display','list-item');
      		}
   			$("ul>li:eq(0) a")[0].click();
      	}
      	
      	
    </script>
  </head>
  
  <body style='height:100%'>
    <div class="itab"  style="margin: 10px 0px;">
    	<!-- 去除tab有空白 -->
    	<ul style="margin: 0;" >
    		<li>
    			<a id="cusIfr" target="customer_ifr" href="customerInfo/toCustomerAdd/${requestScope.customerId}/${requestScope.roomId}/${requestScope.customerStatus}">产权人信息</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="roomInfo/toRoomDecorate/${requestScope.roomId}/${requestScope.customerId}">室内装饰信息</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="p_customer/p_detail/indoorManage-list.jsp">室内使用信息</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="p_customer/pet/petList.jsp">宠物管理</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="p_customer/p_detail/carManage-list.jsp">车辆管理</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="p_customer/p_detail/eventRecord-list.jsp">特定事件记录</a>
    		</li>
    		<li class="hiddenLi">
    			<a target="customer_ifr" href="p_customer/p_detail/customerCredit-list.jsp">信用信息</a>
    		</li>
    	</ul>
    </div>
    <!-- 房间id -->
    <input type="hidden" value="" id="roomId" name="roomId"/>
    <!-- 客户id -->
    <input type="hidden" value="" id="customerId" name="customerId"/>
    <input type="hidden" value="" id="history" name="history"/>
    <!-- 客户的历史状态 -->
    <input type="hidden" value="${historyStatus }" id="historyStatus" name="historyStatus">
    <!-- 去除滚动条 -->
    <div style="height:calc(100% - 56px);">
    	<iframe id="customer_ifr" name="customer_ifr" width="100%" style="height:100%;" frameborder="0" >
    		
    	</iframe>
    </div>
    <!-- 必须放在最后 否则与滚动条文件冲突 -->
    <script src="js/select2/select2.min.js"></script>
    <script type="text/javascript" src="js/sharefunction.js"></script>
  </body>
</html>
